package sar

import java.awt.GraphicsConfiguration.DefaultBufferCapabilities;

class HomeController {

	def index() {
		def countProgram=Program.count
		def countCourse=Course.count

		def countTeachingSession=TeachingSession.count

		def countLectureSession=TeachingSession.findAllByType("Lecture").size()
		def countTutorialSession=TeachingSession.findAllByType("Tutorial Session").size()
		def countLabSession=TeachingSession.findAllByType("Lab Session").size()

		def countPlace=Place.count
		def countRoom=Place.findAllByType("Room").size()
		def countTheatre=Place.findAllByType("Lecture Theatre").size()
		def countLabs=Place.findAllByType("Laboratory").size()

		def countUser=User.count
		def countStudent=Student.count
		def countTutor=Tutor.count
		def countCourseCoordinator=CourseCoordinator.count
		def countStaff=Staff.count

		[
			countProgram:countProgram,countCourse:countCourse,countTeachingSession:countTeachingSession,
			countLectureSession:countLectureSession,countTutorialSession:countTutorialSession,countPlace:countPlace,
			countRoom:countRoom,countTheatre:countTheatre,countLabs:countLabs,countUser:countUser,
			countStudent:countStudent,countTutor:countTutor,countCourseCoordinator:countCourseCoordinator,
			countStaff:countStaff
		]
	}
}
